package com.nancy.main;

import com.nancy.service.OrderConsumer;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UseConsumer {

    public static void main(String[] args) throws InterruptedException {
        @SuppressWarnings("resource")
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                new String[]{"consumer.xml"});
        context.start();
        OrderConsumer consumer = (OrderConsumer) context.getBean("orderConsumer");
        // Executing remote methods
        String hello = consumer.sayHello("world333");
        // Display the call result
        System.out.println(hello);

        Object wait = new Object();
        synchronized (wait) {
            wait.wait();
        }

    }

}
